//
//  LYPlaybackContentCell.m
//  LYLiveApp
//
//  Created by QD on 2017/7/18.
//  Copyright © 2017年 览益信息科技. All rights reserved.
//

#import "LYPlaybackContentCell.h"
#import "LYPlaybackModel.h"

@interface LYPlaybackContentCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;
@property (weak, nonatomic) IBOutlet UIView *bgView;

@end

@implementation LYPlaybackContentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(LYPlaybackModel *)model {

    _model = model;
    self.titleLabel.text = model.vtitle;
    self.nameLabel.text = [NSString stringWithFormat:@"%@/%@",model.name,model.teacher];
    self.numberLabel.text = model.videoTime;
}

- (void)selectCellState {
    
    self.bgView.backgroundColor = [UIColor colorWithHexString:@"#d94b41" alpha:0.8];
    self.titleLabel.textColor = [UIColor whiteColor];
    self.nameLabel.textColor = [UIColor whiteColor];
    self.numberLabel.textColor = [UIColor whiteColor];

}

- (void)normalCellState {

    self.bgView.backgroundColor = [UIColor whiteColor];
    self.titleLabel.textColor = [UIColor colorWithHexString:@"#585858"];
    self.nameLabel.textColor = [UIColor colorWithHexString:@"#929292"];
    self.numberLabel.textColor = [UIColor colorWithHexString:@"#929292"];
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"LYPlaybackContentCell";
    LYPlaybackContentCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil)
    {
        cell = [[[NSBundle mainBundle]loadNibNamed:@"LYPlaybackContentCell" owner:self options:nil] lastObject];
    }
    return cell;
}

@end
